<template>
  <div>测试国际化</div>
  <hr />
  <div>
    {{ $t("header.home") }}
  </div>
  <button @click="setLang('en')">英文</button>
  <button @click="setLang('zh')">中文</button>
  <p>https://kazupon.github.io/vue-i18n/zh/started.html</p>
</template>

<script lang="ts">
export default {
  name: "TestLanguage",
};
</script>
<script lang="ts" setup>
import { useI18n } from "vue-i18n";
const i18n = useI18n();
let setLang = (lang: string) => {
  i18n.locale.value = lang;
};
</script>

<style scoped></style>
